﻿#pragma once

#include <vcruntime_string.h>

#include "TextHolder.h"

enum class Attribute_type : uint8_t {
	HealthAttribute = 0,
	PlayerHungerAttribute,
	MovementAttribute,
	AbsorptionAttribute,
	PlayerSaturationAttribute,
	AttackDamageAttribute,
	FollowRangeAttribute,
	PlayerLevelAttribute, 
	PlayerExperienceAttribute,
	KnockbackResistanceAttribute,
	LuckAttribute,
};

class Attribute final {
public:
	int64_t hash{};
	int64_t hashedStringHash{};
	TextHolder attributeName{};

private:
	[[maybe_unused]] uint8_t __padding[0x32]{};

public:
	Attribute()  = default;

	Attribute(int64_t h)  : hash(h){};

	explicit Attribute(Attribute_type at)  {
		switch (at) {
		case Attribute_type::HealthAttribute:
			hash = 25769804032;
			break;
		case Attribute_type::PlayerHungerAttribute:
			hash = 4294967552;
			break;
		case Attribute_type::MovementAttribute:
			hash = 38654705921;
			break;
		case Attribute_type::AbsorptionAttribute:
			hash = 55834575105;
			break;
		case Attribute_type::PlayerSaturationAttribute:
			hash = 8589934848;
			break;
		case Attribute_type::AttackDamageAttribute:
			hash = 51539607553;
			break;
		case Attribute_type::FollowRangeAttribute:
			hash = 30064771073;
			break;
		case Attribute_type::PlayerLevelAttribute:
			hash = 17179869440;
			break;
		case Attribute_type::PlayerExperienceAttribute:
			hash = 21474836736;
			break;
		case Attribute_type::KnockbackResistanceAttribute:
			hash = 34359738369;
			break;
		case Attribute_type::LuckAttribute:
			hash = 60129542401;
			break;
		default:
			break;
		}
	}
};

class AttributeInstance final {
private:
	uint8_t __padding[0x74]{};

public:
	float minimumValue{};
	float maximumValue{};
	float currentValue{};

	~AttributeInstance()  = default;
	virtual void tick(void) ;
};